package com.hbnu.array;

public class DemoArray12 {
    //验证值传递
    public static void main(String[] args) {
        int a = 10;
        notchangevalue(a);
        System.out.println(a);
        a = changevalue(a);
        System.out.println(a);
    }

    private static void notchangevalue(int a) {
        a *= 2;//本行改变的是私有函数中的临时变量的值，不会改变main函数中的值
    }

    private static int changevalue(int a) {
        a *= 2;
        return a;
    }
}
